<?php
header ( 'Content-type: text/html; charset=utf-8' );
$mysql_server_name = "localhost";
$mysql_username = "root";
$mysql_password = "root";
$mysql_database = "db_shop";

$conn = mysql_connect ( $mysql_server_name, $mysql_username, $mysql_password );
mysql_query ( "set names 'utf8'" );

// require_once('page.php');
// page($sql,'room.php',"5");//这几句诗分页的句子
// $sql = " SELECT * FROM room ORDER BY room_id DESC limit".$begincount.",".$rows;
mysql_select_db ( $mysql_database );

$id = $_POST ['id'];

$room_type = $_POST ['type'];
$compensation = $_POST ['compensation'];
$income = $_POST ['income'];
$time = $_POST ['time'];
$operator_id = $_POST ['operator'];

$sql = "UPDATE hotel.cash SET room_type='$room_type',compensation='$compensation',income='$income',time='$time' ,operator_id='$operator_id' where num='$id'";
mysql_select_db ( $mysql_database );
$result = mysql_query ( $sql );

if (! $result) {
	echo "<font size= '8'>PHP ERROR:错误信息，修改失败！请返回上一页</font><br>" . "<a href ='javascript:history.go(-1)'>鐐瑰嚮杩斿洖</a>";
} else {
	echo "<script language=javascript>alert(\'修改成功');window.location='cash.php?id=" . $id . "';</script>";
}

?>